<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="*|/"><xsl:apply-templates/></xsl:template>

<xsl:template match="text()|@*"><xsl:value-of select="."/></xsl:template>

<xsl:template match='nbsp' name='nbsp'>
<xsl:text disable-output-escaping='yes'>&amp;nbsp;</xsl:text>
</xsl:template>


<xsl:template match="locs">

<xsl:comment>
1 - active location
2 - location no longer active
4 - waiting to be evaluated
</xsl:comment>
  <div style="background:#EC2C29;margin-bottom:10px; width:100%;" class="round_me">
  
<table style="background:white;margin-top:10px;margin-bottom:10px;margin-left:3px;margin-right:3px;" class="body_10px" border="0" cellspacing="0" cellpadding="3">
  <!--  <tr class="body" style="background:#EC2C29;color:white;">
    <td align="right" colspan="4">filtra per</td>
  </tr>
  -->
<tr class="body" style="background:#EC2C29;color:white;">
<td><b>Nome del locale</b></td>
<td><b>Indirizzo</b></td>
<td>
</td>

<td width="5%" align="center"><b>Net</b></td>

</tr>

<xsl:for-each select="loc">
  <tr>
    <td style="border-bottom:1px solid #EC2C29;">
<div style="float:left;padding-right:10px;">
  <xsl:choose>
    <xsl:when test="floor( @life div 1 ) mod 2">
      <img src="/imgs/icons/lightbulb.png"/>
    </xsl:when>
    <xsl:otherwise>
      <img src="/imgs/icons/lightbulb_off.png"/>
    </xsl:otherwise>
  </xsl:choose>
</div>
<div style="padding-top:5px;">
<xsl:value-of select="@name"/>
</div>
</td>
<td style="border-bottom:1px solid #EC2C29;">

<xsl:choose>
	<xsl:when test='string-length(@longitude)&gt;0'>
		<a target="_blank" style="text-decoration:underline;" href="/gmap.aspx?longitude={@longitude}&amp;latitude={@latitude}&amp;name={@name}&amp;address={@address}&amp;nr={@nr}&amp;zip={@zip}&amp;city={@cityname}&amp;country={@isocountry}"><xsl:value-of select="@address"/>&#160;<xsl:value-of select="@nr"/><br/><xsl:value-of select="@cityname"/>, <xsl:value-of select="@isocountry"/></a>
	</xsl:when>
	<xsl:otherwise>
		<xsl:value-of select="@address"/>
	</xsl:otherwise>
</xsl:choose>

</td>
    <td style="border-bottom:1px solid #EC2C29;">
      <form style="display:inline;" action="" name="dosomething{@lid}">
        <nobr>
          <input type="hidden" name="lid" value="{@lid}"/>
          <input type="hidden" name="life" value="{/locs/@life}"/>
          <input class="body" type="button" name="modifica" value="EDIT" onclick="window.location='/locali/localeedit.aspx?lid={@lid}'"/>
        <select onchange="javascript:document.dosomething{@lid}.submit();" style="margin-left:10px;font-family:tahoma,monospace" name="action">
          <option value="0" style="">
            <span style="margin-left:10px;">Oppure...</span>
          </option>
          <option value="PREVIEW" style="margin-top:4px;margin-bottom:4px;">&#160;&#160;Anteprima pagina locale</option>
          <option value="LOADBANNER" style="margin-top:4px;margin-bottom:4px;">&#160;&#160;Carica banner</option>
          <xsl:choose>
            <xsl:when test="(floor( @life div 1 ) mod 2)">
              <option value="TURNOFF" style="">
                <span style="margin-left:10px;">&#160;&#160;Disattiva locale</span>
              </option>
            </xsl:when>
            <xsl:otherwise>
              <option value="TURNON" style="">
                <span style="margin-left:10px;">&#160;&#160;Attiva locale</span>
              </option>
            </xsl:otherwise>
          </xsl:choose>
          <xsl:choose>
            <xsl:when test="(floor( @life div 1 ) mod 2)">
              <option style="margin-bottom:4px;color:gray;" value="0" >
                <span style="margin-left:10px;">&#160;&#160;Elimina locale</span>
              </option>
            </xsl:when>
            <xsl:otherwise>
              <option style="margin-bottom:4px;" value="DELETE">&#160;&#160;Elimina locale</option>
            </xsl:otherwise>
          </xsl:choose>
        </select>
        </nobr>
      </form>
    </td>
<td style="border-bottom:1px solid #EC2C29;" width="80px" align="center">
  <xsl:choose>
    <xsl:when test="(floor( @life div 8 ) mod 2) and (floor( @status div 32 ) mod 2) and string-length(@bannerhalfsky) &gt; 0">
      <img src="/imgs/icons/coins_add.png"/>
    </xsl:when>
    <xsl:when test="(floor( @life div 8 ) mod 2) and 0=(floor( @status div 32 ) mod 2) and string-length(@bannerhalfsky) &gt; 0">
      <img src="/imgs/icons/coins_delete.png"/>
    </xsl:when>
    <xsl:when test="(floor( @life div 8 ) mod 2)">
      <img src="/imgs/icons/coins.png"/>
    </xsl:when>
    <xsl:otherwise>
      <img width="16px" src="/imgs/spacer.gif"/>
    </xsl:otherwise>
  </xsl:choose>
</td>
  </tr>
</xsl:for-each>
</table>
  </div>
  <center>
  <div>
    <img src="/imgs/icons/coins_add.png"/> = network, con banner attivo
    &#160;&#160;
    <img src="/imgs/icons/coins_delete.png"/> = network, con banner non attivo
    &#160;&#160;
    <img src="/imgs/icons/coins.png"/> = network
  </div>
  </center>
</xsl:template>

</xsl:stylesheet>